/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import beans.Fatura;
import beans.Historico;
import beans.HistoricoFatura;
import beans.Teste;
import beans.Usuario;
import beans.UsuarioPermissao;
import beans.Mail;

/**
 *
 * @author Caio
 */
public class DAOFactory {
    
    public static InterfaceHibernateDAO<Teste> criarTesteDAO(){
        HibernateDAO<Teste> dao = new HibernateDAO<Teste>(Teste.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
    public static InterfaceHibernateDAO<Usuario> criarUsuarioDAO(){
        HibernateDAO<Usuario> dao = new HibernateDAO<Usuario>(Usuario.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
    public static InterfaceHibernateDAO<UsuarioPermissao> criarUsuarioPermissaoDAO(){
        HibernateDAO<UsuarioPermissao> dao = new HibernateDAO<UsuarioPermissao>(UsuarioPermissao.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
    public static InterfaceHibernateDAO<Mail> criarMailDAO(){
        HibernateDAO<Mail> dao = new HibernateDAO<Mail>(Mail.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
    public static InterfaceHibernateDAO<Historico> criarHistoricoDAO(){
        HibernateDAO<Historico> dao = new HibernateDAO<Historico>(Historico.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
    public static InterfaceHibernateDAO<Fatura> criarFaturaDAO(){
        HibernateDAO<Fatura> dao = new HibernateDAO<Fatura>(Fatura.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
    public static InterfaceHibernateDAO<HistoricoFatura> criarHistoricoFaturaDAO(){
        HibernateDAO<HistoricoFatura> dao = new HibernateDAO<HistoricoFatura>(HistoricoFatura.class);
        dao.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
        return dao;
    }
    
}
